using System;
using NFreeMarker.Template;

namespace NFreeMarker.Ext.Beans
{
    /**
     * Utility class for instantiating {@link StaticModel} instances from
     * templates. If your template's data model contains an instance of
     * StaticModels (named, say <tt>StaticModels</tt>), then you can
     * instantiate an arbitrary StaticModel using get syntax (i.e.
     * <tt>StaticModels["java.lang.System"].currentTimeMillis()</tt>).
     * @author Attila Szegedi
     * @version $Id: StaticModels.java,v 1.12.4.1 2006/11/12 10:23:02 szegedia Exp $
     */
    class StaticModels : ClassBasedModelFactory
    {
        internal StaticModels(BeansWrapper wrapper)
            : base(wrapper)
        {
        }

        protected override ITemplateModel CreateModel(Type type)
        {
            return new StaticModel(type, GetWrapper());
        }
    }
}